<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <#assign currentMenu="comment"/>
    <#include "../common/header.ftl">
    <script src="/js/plugins/jquery-bootstrap/jquery.bootstrap.min.js"></script>
    <script src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .modal-body {
            max-height: 750px;
            overflow-y: auto;
        }
        .modal-body img {
            width: 100%;
        }
    </style>

</head>
<body>

<div class="container " style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-lg-3">
            <#include "../common/menu.ftl">
        </div>
        <div class="col-lg-9">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-head-line">点评信息管理</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/strategyComment/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label>关键字:</label>
                    <input type="text" class="form-control" name="keyword" value="${(qo.keyword)!}"
                           placeholder="请输入点评信息">
                </div>
                <button id="btn_query" class="btn btn-info">
                    <span class="glyphicon glyphicon-search"></span> 查询
                </button>
            </form>

            <table class="table table-striped table-hover">
                <tr>
                    <th>序号</th>
                    <th>点评者</th>
                    <th>点评星级</th>
                    <th>点评内容</th>
                    <th>点评时间</th>
                    <th>点评攻略</th>
                    <th>操作</th>
                </tr>
                <#list pageInfo.list as entity>
                    <tr>
                        <td>${entity_index + 1}</td>
                        <td>${entity.author.nickName}</td>
                        <td>${(entity.grade)!}</td>
                        <td>${entity.content}</td>
                        <td>${entity.createDate?string("yyyy-MM-dd HH:mm:ss")}</td>
                        <td>${entity.strategy.title}</td>
                        <td>
                            <a role="button" class="btn btn-danger btn-xs removeBtn" data-did="${entity.id}">
                                <span class="glyphicon glyphicon-remove"></span> 删除
                            </a>
                        </td>
                    </tr>
                </#list>
            </table>
            <#include "../common/page.ftl">
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        //删除
        $(".removeBtn").click(function () {
            //获取点评信息的id
            var id = $(this).data("did");
            //判断是否为删除
            $.get('/strategyComment/delete.do?id=' + id, function (data) {
                if (data.success) {
                    window.location.reload();
                } else {
                    alert("兄弟,你摊上大事了");
                }
            })
        })
    })
</script>
</body>
</html>